Skip to content

fix(Image): handle SSR image already complete before inline script runs#1536

Merged
Marcosld merged 2 commits into
masterfrom
fix-flaky-ssr-test
Apr 22, 2026
Merged

fix(Image): handle SSR image already complete before inline script runs#1536
Marcosld merged 2 commits into
masterfrom
fix-flaky-ssr-test

Conversation

@Marcosld
Copy link
Copy Markdown
Contributor

@Marcosld Marcosld commented Apr 20, 2026

Problem

The inline <script> rendered after <img> in SSR attached a load listener to set the image opacity to 1. When the image finished loading before that script was parsed, the listener never fired and the image stayed at opacity: 0, producing flaky snapshot diffs in the SSR acceptance test.

Fix

Check img.complete first and set opacity = "1" synchronously in that case; fall back to the load listener otherwise.

Ref: WEB-2429

@Marcosld Marcosld self-assigned this Apr 20, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 20, 2026

Size stats

master this branch diff
Total JS 16.1 MB 16.1 MB +144 B
JS without icons 2.01 MB 2.01 MB +144 B
Lib overhead 92.5 kB 92.5 kB 0 B
Lib overhead (gzip) 19.9 kB 19.9 kB 0 B

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 20, 2026

Deploy preview for mistica-web ready!

Project:mistica-web
Status: ✅  Deploy successful!
Preview URL:https://mistica-aug9r9isp-flows-projects-65bb050e.vercel.app
Latest Commit:23aa10b
Inspect:View deployment

Deployed with vercel-action

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 20, 2026

Accessibility report
✔️ No issues found

ℹ️ You can run this locally by executing yarn audit-accessibility.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

Screenshot tests report

✔️ All passing

The inline <script> rendered after <img> in SSR attached a 'load'
listener to set opacity to 1. When the image finished loading before
the script was parsed, the listener never fired and the image stayed
at opacity 0 — causing flaky snapshot diffs in the SSR acceptance test.
Check img.complete first and set opacity synchronously in that case.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Marcosld Marcosld force-pushed the fix-flaky-ssr-test branch from 63bf283 to 15c1a85 Compare April 21, 2026 15:10
@Marcosld Marcosld requested a review from atabel April 22, 2026 08:27
@Marcosld Marcosld changed the title fix-flaky-ssr-test: Test in ci fix(Image): handle SSR image already complete before inline script runs Apr 22, 2026
@Marcosld Marcosld requested a review from ieduardogf April 22, 2026 08:27
@Marcosld Marcosld marked this pull request as ready for review April 22, 2026 08:27
@Marcosld Marcosld added the AI AI Generated label Apr 22, 2026
@Marcosld Marcosld enabled auto-merge April 22, 2026 08:44
@Marcosld Marcosld added this pull request to the merge queue Apr 22, 2026
Merged via the queue into master with commit ec1e35c Apr 22, 2026
11 checks passed
@Marcosld Marcosld deleted the fix-flaky-ssr-test branch April 22, 2026 09:07
@tuentisre
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 16.61.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

yceballost pushed a commit to MurilloLeoni/mistica-web that referenced this pull request Apr 27, 2026
# [16.61.0](Telefonica/mistica-web@v16.60.0...v16.61.0) (2026-04-24)

### Bug Fixes

* **Image:** handle SSR image already complete before inline script runs ([Telefonica#1536](Telefonica#1536)) ([ec1e35c](Telefonica@ec1e35c))

### Features

* **chore:** Minimal github conventions ([Telefonica#1530](Telefonica#1530)) ([f7ca38a](Telefonica@f7ca38a))
* **fixedFooterLayout:** include footerScrollEffect prop ([Telefonica#1532](Telefonica#1532)) ([bd56fb2](Telefonica@bd56fb2))
* **llms:** Include source code in mistica package ([Telefonica#1531](Telefonica#1531)) ([bf6280b](Telefonica@bf6280b))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI AI Generated released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants